package com.iflytek.sbd.filter;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @program: sbd
 * @description: 参数过滤器
 * @author: 陈英俊
 * @create: 2021-12-30 10:06
 */

//@WebFilter(urlPatterns = {"/demo/*"})
public class ParameterFilter implements Filter {
    private final Logger logger = LoggerFactory.getLogger(ParameterFilter.class);


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        //logger.info("ParameterFilter(2)初始化完成.....");
        System.out.println("ParameterFilter(2)初始化完成.....");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        //  logger.info("ParameterFilter(2)处理中.....");
        System.out.println("进入ParameterFilter(2).....");
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        //   logger.info("ParameterFilter(2)销毁啦.....");
        System.out.println("ParameterFilter(2)销毁啦.....");
    }
}
